package com.tiancheng.trade.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 履约状态 (0违约 1履约)
 */
@Getter
@AllArgsConstructor
public enum CreditOrderContractStateEnum {
    BREACH (0, "违约"),
    OBSERVE(1, "履约")
    ;
    private Integer code;
    private String desc;

    public static String getDesc(Integer code) {
        CreditOrderContractStateEnum[] businessModeEnums = values();
        for (CreditOrderContractStateEnum statusEnum : businessModeEnums) {
            if (statusEnum.code().equals(code)) {
                return statusEnum.desc();
            }
        }
        return null;
    }

    public Integer code() {
        return this.code;
    }

    public String desc() {
        return this.desc;
    }
}
